package org.com.coolfish.common.database.repository;

import java.util.List;
import org.com.coolfish.common.database.entity.KuyuPackagePrice;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface KuyuPackagePriceRepository extends JpaRepository<KuyuPackagePrice, Integer> {
	 //@Query("SELECT NEW KuyuPackagePrice(pp.aid,pp.price,pp.parentprice) FROM KuyuPackagePrice pp WHERE pp.pid=:packageId")
	 @Query("SELECT NEW KuyuPackagePrice(p.price,p.parentprice) FROM KuyuPackagePrice p WHERE p.pid=:packageId AND p.aid =:fid")
     KuyuPackagePrice findFidPackagePriceCardMessage(@Param("packageId") Integer packageId,@Param("fid") Integer fid);
	 
	 @Query("SELECT NEW KuyuPackagePrice(p.price,p.parentprice) FROM KuyuPackagePrice p WHERE p.pid=:packageId AND p.aid =:sid")
	 KuyuPackagePrice findSidPackagePriceCardMessage(@Param("packageId") Integer packageId,@Param("sid") Integer sid);
	
	 @Query("SELECT NEW KuyuPackagePrice(p.price,p.parentprice) FROM KuyuPackagePrice p WHERE p.pid=:packageId AND p.aid =:tid")
	 KuyuPackagePrice findTidPackagePriceCardMessage(@Param("packageId") Integer packageId,@Param("tid") Integer tid);
	
	
	/* @Query("SELECT NEW KuyuPackagePrice(p.price,p.parentprice) FROM KuyuPackagePrice p WHERE p.pid=:packageId AND p.aid in(:fid,:sid,:tid)")
	 List<KuyuPackagePrice> findPackagePriceCardMessage(@Param("packageId") Integer packageId,@Param("fid") Integer fid,@Param("sid") Integer sid,@Param("tid") Integer tid);*/
	 


}
